#pragma once

#include "glare.gles2.Prerequisites.h"
#include "glare.core.Driver.h"
#include "glare.core.DriverCapabilities.h"

namespace Glare {

	class GLES2Driver : public Driver
	{
	public : static string Name;

	public : GLES2Driver();
	public : virtual ~GLES2Driver();

	public : virtual GpuResourceFactory* GetGpuResourceFactory() const;
	public : virtual ShaderFactory* GetShaderFactory() const;
	public : virtual DrawStateFactory* GetDrawStateFactory() const;

	public : virtual std::string& GetName() const;

	public : virtual RenderWindow* CreateRenderWindow(PlatformWindow* platform_window);
	public : virtual void DestroyRenderWindow(RenderWindow* render_window);

	public : virtual const DriverStage::Type GetSupportedStages() const;
	public : virtual const DriverCapabilities& GetCapabilities() const;

	public : virtual DrawContext* GetImmediateDrawContext() const;
	public : virtual DrawContext* CreateDrawContext();
	public : virtual void DestroyDrawContext(DrawContext* draw_context);

	public : GLES2ShaderFactory* GetGLES2ShaderFactory() const;

	private : DriverCapabilities _driver_caps;

	private : GLES2GpuResourceFactory* _gpu_resources;
	private : GLES2ShaderFactory* _gpu_shaders;
	private : GLES2DrawStateFactory* _draw_states;

	private : GLES2DrawContext* _immediate_draw_context;
	};

}

